<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=no">
    <style>
        * {
            padding: 0;
            margin: 0;
            list-style: none;
        }

        body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        }

        .canvas {
            width: 70%;
            height: 40%;
            margin-left: 15%;
            /*margin: 0;*/
            padding: 0;
            display: block;
            background: cadetblue;
            /*border: 1px solid black;*/
        }
    </style>
</head>
<body>
<div class="content_body">
    <canvas class="canvas"></canvas>
</div>
<script>
    let canvas = document.getElementsByClassName("canvas")[0];
    let ctx = canvas.getContext('2d');
    ctx.moveTo(100, 100);//移动画笔（x轴，y轴）
    ctx.lineTo(200, 100);//绘制直线（轨迹，绘制路径）
    ctx.stroke();//描边
</script>
</body>
</html>